<?php

namespace App\Ship\Traits;

use App\Containers\AppSection\Profile\Tasks\CheckProfileAccreditationStatusTask;

trait AccreditationStatusPermissionTrait
{
    public function profileIsNotRejected(): bool
    {
        return app(CheckProfileAccreditationStatusTask::class)->run($this->profile()->id, ['accreditation_rejected'], false);
    }

    public function profileIsNotAccredited(): bool
    {
        return app(CheckProfileAccreditationStatusTask::class)->run($this->profile()->id, ['accreditation_not_accredited'], true);
    }

    public function profileIsReturned(): bool
    {
        return app(CheckProfileAccreditationStatusTask::class)->run($this->profile()->id, ['accreditation_returned'], true);
    }

    public function profileIsAccredited(): bool
    {
        return app(CheckProfileAccreditationStatusTask::class)->run($this->profile()->id, ['accreditation_accredited'], true);
    }
}
